<template>
  <div>
    <nav-bar :title="msg" bgColor=""></nav-bar>
    <select-bar :itemInfo="arr" v-on:callBack="selectBarItemClick" style="margin-top: 0.11rem"></select-bar>
    <!--转账-->
    <div v-show="selectBarTag===0">
        <trans-component></trans-component>
    </div>
    <!--查询-->
    <div v-show="selectBarTag===1">
        <search-componet></search-componet>
    </div>
  </div>

</template>

<script>
import navBar from '../../components/navBar'
import selectBar from '../../components/selectBar'
import transComponent from './transComponent'
import searchComponet from './searchComponet'

export default {
  name: 'home',
  data () {
    return {
      msg: '宝易付转账',
      selectBarTag: 0,
      arr: [{name: '转账'}, {name: '查询'}],
    }
  },

  mounted(){
  },

  components: {navBar, selectBar,transComponent,searchComponet},
  methods: {

    /*切换*/
    selectBarItemClick (index = 0) {
      this.selectBarTag = index
      if (index === 0) {
        this.msg = '宝易付转账'
      }
      if (index === 1) {
        this.routeName = ''
        this.msg = '余额查询'
      }
    },
  },
}
</script>

<style scoped lang="less">

</style>
